package Computer.Event;

import Computer.Main.Address;
import Computer.Main.Memory;
import Computer.Main.Pointer;
import Computer.Main.ProgramCounter;

public abstract class Arithmetic implements Instruction {

	protected Pointer ptr1;
	protected Pointer ptr2;
	protected Address addr;
	
	public Arithmetic (Pointer ptr1, Pointer ptr2, Address addr) {
		this.ptr1 = ptr1;
		this.ptr2 = ptr2;
		this.addr = addr;
	}
	
	public void execute(Memory memory, ProgramCounter counter) {
		operation(memory);
		counter.increment();
	}
	
	public abstract void operation(Memory memory);
	
	public abstract String name();
	
	public String toString(){
		return name() + ptr1 + " " + ptr2 + " " + addr;
	}
}
